<template>
  <div class="safeBox">
    <div class="safeItem">
      <div class="info">
        <div class="title">
          您当前的帐号
        </div>
        <div class="desc btns">
          {{ user.cPhone }}
        </div>
      </div>
    </div>
    <div class="safeItem">
      <div class="info">
        <div class="title">
          绑定手机
        </div>
        <div class="desc">
          绑定手机：<span class="btns">{{ user.cPhone }}</span>，用于支付安全和收货提醒等，若手机丢失或停用，请及时更换
        </div>
      </div>
      <div
        class="btns"
        @click="updatePhone"
      >
        修改
      </div>
    </div>
    <div class="safeItem">
      <div class="info">
        <div class="title">
          绑定邮箱
        </div>
        <div class="desc">
          {{
            user.cEmail
              ? user.cEmail
              : "验证后，可用于快速找回登录密码，接受账户余额变动提醒"
          }}
        </div>
      </div>
      <div class="btns" @click="getEmall">
        立即绑定
      </div>
    </div>
    <div class="safeItem">
      <div class="info">
        <div class="title">
          忘记密码
        </div>
        <div class="desc">
          用于找回密码的快捷方式
        </div>
      </div>
      <div class="btns" @click="getPwd">
        修改
      </div>
    </div>
    <div class="tips">
      <div class="titles">
        安全服务提示
      </div>
      <div class="desc">
        <div>
          •
          确认您登录的是INJA网址WWW.INJA.com,注意防范进入钓鱼网站，不要轻信各种即时通讯工具发送的商品或支付链接，谨防网购诈骗
        </div>
        <div>
          • 建议您安装杀毒软件，并定期更新操作系统等软件补丁，确保帐号及交易安全
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      user: {},
    };
  },

  mounted() {
    this.getData();
  },
  methods: {
    //获取个人信息
    getData() {
      let paramse = {
        token: localStorage.getItem("token"),
        data : {}
      }
      this.$api.person.userInfo(paramse).then((res) => {
        // 执行某些操作
        if (res.code == 200) {
          this.user = res.data;
        }
      });
    },
    updatePhone() {
      this.$router.push({
        path: "/person/updatephone",
      });
    },
    // 绑定邮箱
    getEmall() {
      this.$router.push({
        path: "/person/updateEmall",
      });
    },
    getPwd(){
      window.open("https://srm.inja.com/public/iiam/forget-password#/")
    }
  },
};
</script>

<style scoped lang="scss">
.safeBox {
  .btns {
    color: #f0406f !important;
    cursor: pointer;

    &:hover {
      text-decoration: underline;
    }
  }

  background: #fff;
  padding: 1.69rem;

  .safeItem {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    font-size: 0.88rem;
    border-bottom: 0.06rem solid rgba(229, 229, 229, 1);

    .info {
      display: flex;
      flex-direction: row;
      color: #666;

      .title {
        width: 10rem;
        // padding-right: 5.94rem;
      }

      .desc {
        color: #999;
      }
    }
  }

  .tips {
    color: #666;

    .titles {
      font-size: 1.13rem;
      padding-top: 1.88rem;
      padding-bottom: 1rem;
    }

    .desc {
      font-size: 0.88rem;

      display: flex;
      flex-direction: column;

      > div {
        padding-bottom: 1rem;
      }
    }
  }
}
</style>
